package com.shopping.admin.controller.user;

import com.alibaba.fastjson.JSONObject;
import com.shopping.common.core.object.ResponseResult;
import com.shopping.common.sp.dto.user.LoginDto;
import com.shopping.service.service.login.LoginService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: shopping-mall
 * @ClassName LoginController
 * @description: 登录模块
 * @author: zlw
 * @create: 2024-03-27 22:37
 * @Version 1.0
 **/

@Api(tags = "用户登录接口")
@RestController
@RequestMapping("/admin/user")
public class LoginController {

    @Autowired
    private LoginService loginService;

    /**
     * 用户名密码登录
     * @param dto
     */
    @PostMapping("/login")
    public ResponseResult<JSONObject> login(@RequestBody LoginDto dto){
       return loginService.login(dto.getUserName(),dto.getPassWord());
    }
}
